home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_06_02
/
v6n2010a.txt
< prev
next >
Wrap
Text File
|
1989-09-26
|
691b
|
26 lines
do_something(a,b)
/* This function does something with a and b*/
{
int ret;
char arg1[10];
char arg2[10];
/* Turn the arguments to strings */
sprintf(arg1,"%d",a);
sprintf(arg2,"%d",b);
/* Execute the program */
if (fork() == 0)
execlp("domain","domain",arg1,arg2);
/* Wait till it is finished and get the return code */
wait(&ret);
/* Shift it over, as the return code is in
the high order bits */
ret >> 8 && 0xFF;
return ret;
}